﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

/**
 * Configuration handler
 * Handles all global configuration
 * 
 * TODO: define configuration format and location
 * @author Sigmar Muuga
 */
namespace twilters
{
   public class ConfigurationHandler
   {
       private String twitterBaseUrl = "https://twitter.com/";
       private String twitterSearchUrl = "http://search.twitter.com/";
       //private String appDataDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + Path.DirectorySeparatorChar + "twilters";
       // TODO: make this user account specific
       private String appDataDir = "C:\\twilters";

       public ConfigurationHandler()
       {
           Directory.CreateDirectory(appDataDir);
       }

       public String baseUrl
       {
           get { return twitterBaseUrl; }
           set { twitterBaseUrl = value; }
       }

       public String searchUrl
       {
           get { return twitterSearchUrl; }
           set { twitterSearchUrl = value; }
       }

       public String getUserDataFile()
       {
           return appDataDir + Path.DirectorySeparatorChar + "twilters_" + Environment.UserName + ".db4o";
       }
   }
}
